Field
The present embodiments relate to techniques for executing web applications. More specifically, the present embodiments relate to a method and system for providing graphics scenegraph rendering to the web applications using native code modules.
Related Art
Computer systems often include a number of native applications that require complex three-dimensional (3D) scenes to be rendered, such as computer games and computer-aided design (CAD) systems. To render 3D scenes, these native applications may use graphics application programming interfaces (APIs) that direct calculations related to graphics rendering to dedicated graphics processing units (GPUs). The additional computational power provided by these GPUs can greatly improve graphics quality and throughput.
Web applications, which have become more prevalent in recent years, are typically written in scripting languages that are unable to utilize low-level graphics APIs that provide graphics hardware acceleration. Instead, graphics rendering for web applications is typically performed by CPUs instead of GPUs. The software-based nature of web-based graphics rendering may thus limit the graphics capabilities of web applications. However, unlike native applications, web applications provide a number of advantages. For example, web applications are capable of executing on multiple platforms, do not require installation, and can be more secure than native applications.
The tradeoff between web application security and native graphics performance may be addressed using a browser plugin that renders graphics for web applications by interfacing with a local graphics hardware device (e.g., a GPU). Such a plugin may correspond to a complex software system that includes various mechanisms for obtaining scene information from the web applications; storing the scene information; processing the scene information using transforms, effects, and shaders; and sending commands to the graphics hardware for rendering the scene. The processing demands of the plugin may additionally require the plugin to be implemented using native code, which is traditionally insecure. Moreover, plugin installation traditionally requires that the browser be restarted, which may lead to a poor user experience. Consequently, the plugin itself may include a number of potential security vulnerabilities that may be exploited by other applications and/or bugs that may lead to system failures.
Hence, what is needed is a mechanism for safely executing native code for web-based graphics rendering while maintaining communication between the native code and graphics hardware.